<script type="text/javascript" src="${basePath}/js/tds-server.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		server.status();
		server.dormant();
	});
</script>
<#include "/component/pagination.html" />

<table id="serverlist" class="table table-striped table-hover">
	<thead>
		<tr>
			<th width="12.5%" scope="col"><@spring.message code='server.name'/></th>
			<th width="12.5%" scope="col"><@spring.message code='server.managementaddr'/></th>
			<th width="12.5%" scope="col"><@spring.message code='server.publicaddr'/></th>
			<th width="12.5%" scope="col"><@spring.message code='server.clusteraddr'/></th>
			<th width="12.5%" scope="col"><@spring.message code='server.osds'/></th>
			<th width="12.5%" scope="col"><@spring.message code='server.monitor'/></th>
			<th width="12.5%" scope="col"><@spring.message code='server.status'/></th>
			<th width="12.5%" scope="col"><@spring.message code='server.moreinfo'/></th>
			<th width="12.5%" scope="col"><@spring.message code='server.operation'/></th>
		</tr>
	</thead>
	<tbody>
		<#list pager.list as item>
		<tr  
				<#if ((item_index+1) % 2 == 0) >class="oddrow"</#if> >
			<td name="name" value="${item.mgmtAddr}" >${item.name}</td>
	        <td>${item.mgmtAddr}</td>
	        <td>${item.pubAddr}</td>
	        <td>${item.cluAddr}</td>
	        <td>${item.osds}</td>
	        <td>${item.mon}</td>
	        <td value="${item.status}" name="status"></td>
	        <td>
	        	<a href="javascript:void(0);" onclick="server.serverinfo(this)" class="s_btnwork xm_zh_btn"
	        		  mgmtaddr="${item.mgmtAddr}" pubaddr="${item.pubAddr}" >...</a>
	    	</td>
	    	  <#if ('${item.isDormant==0}') >
	        <td value="${item.isDormant}" name="isDormant">
				<a class="btn btn-primary btn-xs btn-danger" onclick="server.operation('${item.mgmtAddr}','${item.isDormant}',this)" name="isDormant"><@spring.message code='server.dormancy'/></a>
	    	</td>
	    	</#if>
	    	 <#if ('${item.isDormant==3}') >
	        <td value="${item.isDormant}" name="isDormant">
				<a class="btn btn-primary btn-xs btn-success" onclick="server.operation('${item.mgmtAddr}','${item.isDormant}',this)" name="isDormant"><@spring.message code='server.disabled'/></a>
	    	</td>
	    	</#if>
	    	<#if ('${item.isDormant==1||item.isDormant==2}') >
	        <td value="${item.isDormant}" name="isDormant">
				<a class="btn btn-primary btn-xs btn-success" onclick="server.operation('${item.mgmtAddr}',1,this)" name="isDormant"><@spring.message code='server.disabled'/></a>
	    	</td>
	    	</#if>         
	    </tr>
		</#list>
	</tbody>
</table>
<@pagination/>
